<!DOCTYPE html>
<html lang="en">

<head>
    <title>大学活动</title>
    <#include "/lx/activity/components/meta.html" />
    <#include "/lx/activity/components/stylesheets.html" />
    <link rel="stylesheet" href="/lx/activity/stylesheets/index.css?v=4">
</head>

<body>
    <div id="app">
        <div class="container">
            <div class="item" v-for="(item, index) in list" :key="item.id" @click="goInfo(item.id)">
                <div class="cover-wrap">
                    <div class="type" v-if="item.type == 1">线下活动<span v-if="item.onGoing == 1"> | 进行中</span><span v-if="item.status == 1"> | 已报名</span><span v-if="item.isOver == 1"> | 已结束</span>
                    </div>
                    <div class="type" v-if="item.type == 2">线上活动<span v-if="item.onGoing == 1"> | 进行中</span><span v-if="item.status == 1"> | 已报名</span><span v-if="item.isOver == 1"> | 回看中</span>
                    </div>
                    <img :src="item.cover" class="cover" />
                </div>
                <div class="title">{{ item.title }}</div>
                <div class='info'>
                    <div class='time'>
                        {{ item.time }}
                    </div>
                    <div class='location' v-if="item.location">
                        {{ item.location }}
                    </div>
                </div>
            </div>
        </div>
    </div>
    <#include "/lx/activity/components/scripts.html" />
    <#include "/lx/activity/components/wxConfig.html" />
    <script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data() {
            return {
                list: []
            }
        },
        mounted: function() {
            this.init();
        },
        methods: {
            init() {
                var self = this;
                var url = '/lx/mini/activity/list';
                var params = {};
                var success = function(res) {
                    self.list = res.info.list;
                }
                var fail = function() {};
                var complete = function() {};
                request(url, params, success, fail, complete);
            },
            goInfo(id) {
                window.location.href = "/lx/mini/activity/detail?id=" + id;
            }
        }
    })
    </script>
    <script>
    wx.ready(function() {
        var title = "超级留学顾问"
        var desc = "超级留学顾问"
        var link = '${host}/mini/activity';
        var imgUrl = "${img!''}"
        initWXShareAll(title, desc, link, imgUrl)
    })
    </script>
</body>

</html>